use tsp_analyzer::cache::Cache;
use tsp_analyzer::drawing::*;
use tsp_analyzer::AnalyzerError;

fn main() -> Result<(), AnalyzerError> {
    tsp::init_log("INFO").unwrap();

    let conn = rusqlite::Connection::open("test.db")?;
    let cache = Cache::new(conn, "data.in", 1)?;

    for i in 1..11 {
        for j in 1..11 {
            log::info!("Start drawing {} {}", i, j);
            draw_pn(
                format!("{}.{}.png", i, j),
                &cache,
                (i as f64) / 10.,
                (j as f64) / 10.,
            )?;
        }
    }

    Ok(())
}
